const Model = require('../models/user-model')

module.exports = {
    // 
    'get::/user/me': async (ctx) => {
        const { query } = ctx.request
        ctx.response.body = {
            token: 'hello ' + query.name
        }
    },
  
    // 
    'post::/user/add': async (ctx) => {
        const { body } = ctx.request
        ctx.response.body = {
            user: { id: 1, ...body }
        }
    },

    // 
    'get::/user/list': async (ctx) => {

        const list = await Model.list(Model.buildPaging(ctx.request.query))

        ctx.response.body = list
    },
}
  